#ifndef SERVERCONNECTION_H
#define SERVERCONNECTION_H

#include "server.h"
#include "connectionplayer.h"
#include <QStringList>


class Server;

class ServerConnection : public ConnectionPlayer
{
    Q_OBJECT
public:
    ServerConnection(QHostAddress a, quint16 p, bool onlyReceive = false,Server*server = 0);
    ServerConnection(bool onlyReceive = false,Server*server = 0);

    Server* server();

private:
    Server* parentServer;

    void runCommand(PacketData* data, bool isNewestPacket);

    void doHELLO(PacketData* args);
    void doDISCONNECT(PacketData* args);
    void doSTATE(PacketData* args);
    void doSHOOT(PacketData* args);
signals:
   void newPlayerConnected(ConnectionPlayer* conn);
};

#endif // SERVERCONNECTION_H
